﻿using System;
using System.IO;
using System.Threading.Tasks;

namespace MaterialTypeRecognition.Shell.SaveInfoService
{
    public interface IStore<TValue>
    {
        void Rent<TType>(Action<TValue> consume) where TType : class, new();

        TType Rent<TType>(Func<Stream, TType> consume) where TType : class, new();

        Task RentAsync<TType>(Action<TValue> consume) where TType : class, new();

        Task<TType> RentAsync<TType>(Func<Stream, TType> consume) where TType : class, new();
    }
}
